home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / lang / amigatalk.lha / intuition / BoopsiVirtualTags.st < prev    next >
Text File  |  2002-05-07  |  2KB  |  55 lines

  1. " --------------------------------------------------------------------- "
  2. " BoopsiVirtualTags Class is a Singleton class that allows the user     "
  3. " to reference BOOPSI Virtual class tags' hexadecimal values.           "
  4. ""
  5. "  EXAMPLE:  'myTag <- virtualTags getTag: #VIRTUALA_Contents'          "
  6. ""
  7. " ALL singleton classes MUST contain the following:                     "
  8. "" 
  9. "  the methods:  isSingleton AND privateSetup     AND                   "
  10. "                 uniqueInstance Class instance variable.               "
  11. " --------------------------------------------------------------------- "
  12.  
  13. Class BoopsiVirtualTags :Dictionary ! uniqueInstance !
  14. [
  15.    isSingleton
  16.      ^ true  
  17. |  
  18.    privateNew ! newinstance !
  19.      newinstance <- super new.
  20.  
  21.      ^ newinstance
  22. |
  23.    new
  24.      ^ self privateSetup
  25. |
  26.    getTag: tagKey
  27.      ^ self at: tagKey
  28. |
  29.    privateInitializeDictionary
  30.  
  31.      self at: #VIRTUALA_Contents    put: 16r85024500.  " (Object *) [IS] "
  32.      self at: #VIRTUALA_Scroller    put: 16r85024501.  " (BOOL)     [IS] "
  33.      self at: #VIRTUALA_ScrollX     put: 16r85024502.  " (WORD)     [ISU] "
  34.      self at: #VIRTUALA_ScrollY     put: 16r85024503.  " (WORD)     [ISU] "
  35.      self at: #VIRTUALA_VisibleX    put: 16r85024504.  " (WORD)     [GN] "
  36.      self at: #VIRTUALA_VisibleY    put: 16r85024505.  " (WORD)     [GN] "
  37.      self at: #VIRTUALA_TopX        put: 16r85024506.  " (WORD)     [ISUGN] "
  38.      self at: #VIRTUALA_TopY        put: 16r85024507.  " (WORD)     [ISUGN] "
  39.      self at: #VIRTUALA_TotalX      put: 16r85024508.  " (WORD)     [GN] "
  40.      self at: #VIRTUALA_TotalY      put: 16r85024509.  " (WORD)     [GN] "
  41.      self at: #VIRTUALA_ScrollerX   put: 16r8502450A.  " (Object *) [I] "
  42.      self at: #VIRTUALA_ScrollerY   put: 16r8502450B.  " (Object *) [I] "
  43.      self at: #VIRTUALA_InputScroll put: 16r8502450C.  " (BOOL)     [IS] "
  44.      self at: #VIRTUALA_NoDispose   put: 16r8502450D.  " (BOOL)     [IS] "
  45. |
  46.    privateSetup
  47.      (uniqueInstance isNil)
  48.        ifTrue: [uniqueInstance <- self privateNew.
  49.                 
  50.                 self privateInitializeDictionary.
  51.                ].
  52.                
  53.      ^ self    "or ^ uniqueInstance??"
  54. ]
  55.